//
//  VC2DatePicker.swift
//  ChapterAll
//
//  Created by Kevin on 2020/4/22.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class VC2DatePicker: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let datePicker = UIDatePicker(frame: CGRect(x: 20, y: 200, width: 300, height: 230))
        datePicker.datePickerMode = .countDownTimer
        view.addSubview(datePicker)
        
        datePicker.addTarget(self, action: #selector(clickDatePicker(ui:)), for: .valueChanged)
    }
    
    @objc func clickDatePicker(ui:UIDatePicker) -> Void {
        print("\(ui.countDownDuration)")
    }
}
